package com.yingdong.centerserver.inner.message;

import io.netty.buffer.ByteBuf;
import io.netty.channel.Channel;

public class GameMessage {
	private ByteBuf buffer;
	private int opcode;
	private int sessionId;
	private Channel channel;
	public ByteBuf getBuffer() {
		return buffer;
	}
	public void setBuffer(ByteBuf buffer) {
		this.buffer = buffer;
	}
	public int getOpcode() {
		return opcode;
	}
	public void setOpcode(int opcode) {
		this.opcode = opcode;
	}
	public int getSessionId() {
		return sessionId;
	}
	public void setSessionId(int sessionId) {
		this.sessionId = sessionId;
	}
	
	public Channel getChannel() {
		return channel;
	}
	public void setChannel(Channel channel) {
		this.channel = channel;
	}
	public GameMessage(ByteBuf buffer, int opcode, int sessionId,Channel channel) {
		super();
		this.buffer = buffer;
		this.opcode = opcode;
		this.sessionId = sessionId;
		this.channel=channel;
	}
	public GameMessage(ByteBuf buffer, Channel channel) {
		super();
		this.buffer = buffer;
		this.channel = channel;
	}
	public int readInt() {
		return buffer.readInt();
	}

	public int readShort() {
		return buffer.readShort();
	}

	public int readByte() {
		return buffer.readByte();
	}

	public double readDouble() {

		return buffer.readDouble();
	}

	public float readFloat() {
		return buffer.readFloat();
	}

	public long readLong() {
		return buffer.readLong();
	}
}
